//
//  LoadingController.m
//  blackjack
//
//  Created by Thi Nguyen Tran on 3/25/10.
//  Copyright 2010 Epsilon. All rights reserved.
//

#import "LoadingController.h"


@implementation LoadingController

@synthesize delegate;

- (void)viewDidLoad {
    [super viewDidLoad];
	
	timer = [NSTimer scheduledTimerWithTimeInterval:0.1f
									target:self
								  selector:@selector(scheduler:) 
								  userInfo:nil
								   repeats:YES];
}

- (void)scheduler:(NSTimer *)t {
	static int count = 0;
	count++;
	if(count > 10) {
		[delegate endLoading];
		[timer invalidate];
		return;
	}
	[progressbar setProgress:(float)(count/10.0)];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
	
}

- (void)dealloc {
    [super dealloc];
}


@end
